Skip to content

Conversation

@dependabot
Copy link

@dependabot dependabot bot commented on behalf of github Jan 27, 2025

Problem

The step-checker feature was causing warnings and preventing sticky disk commits in container jobs:

Warning: Unable to check for previous step failures: _diag directory not found at /__w/web/web/_diag
Warning: Skipping sticky disk commit due to ambiguity in failure detection

Root Cause:

  • Container jobs mount the workspace at /__w/ inside the container
  • The _diag directory exists on the host at /home/runner/_diag but is not mounted into containers
  • The step-checker tried to access _diag and failed, returning an error
  • This prevented sticky disk commits from happening
  • Modern kernels use cgroup v2 which doesn't include docker/containerd in the path

Impact:

  • Affecting container jobs since the step-checker was deployed
  • Only affects jobs with container: in workflow config

Solution

Add multi-layered container detection that works with both old and new systems:

  1. Check for /.dockerenv file (docker-specific indicator)
  2. Check /proc/1/cgroup for docker/containerd (cgroup v1)
  3. Check if working directory starts with /__w/ (GitHub Actions container mount - works with cgroup v2)

When any of these conditions are met, skip the step-checker gracefully since _diag is not accessible.

No changes to existing path detection logic - only adds the container check at the beginning.

Testing

  • ✅ Build successful
  • ✅ All tests pass
  • ✅ Verified detection works in actual container (pwd starts with /__w/ ✓)
  • ✅ Container jobs will now skip step-checker and allow sticky disk commits
  • ✅ Non-container jobs continue to work exactly as before

Verification in VM

Tested in actual container environment:

✓ Has /.dockerenv
✗ Not in cgroup (cgroup v2: "0::/")
✓ PWD starts with /__w/
✓ CONTAINER DETECTED - step-checker will be skipped

Related

This is the same fix applied to setup-docker-builder in useblacksmith/setup-docker-builder#53

Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4.1.0 to 4.2.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](actions/setup-node@v4.1.0...v4.2.0)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot @github
Copy link
Author

dependabot bot commented on behalf of github Jan 27, 2025

The following labels could not be found: chore.

@dependabot @github
Copy link
Author

dependabot bot commented on behalf of github Apr 25, 2025

Superseded by #60.

@dependabot dependabot bot closed this Apr 25, 2025
@dependabot dependabot bot deleted the dependabot/github_actions/actions/setup-node-4.2.0 branch April 25, 2025 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants